package com.example.proxy2_java;

import com.example.proxy1_static.IMessage;
import com.example.proxy1_static.QQMsg;

/**
 * QQMsg 被代理类
 * Proxy java自带的代理类
 * MessageHandler 执行类
 */
public class AppTest {
    public static void main(String[] args) {
        MessageHandler msgHandler = new MessageHandler();
        IMessage msg = (IMessage)msgHandler.bind(new QQMsg());
        msg.send("hello world");

        // output:
        //     ↓ before send
        //     send qq msg: hello world
        //     ↑ sent
    }
}
